\rcube_result_index

Class for accessing IMAP's SORT/SEARCH/ESEARCH result

Summary

Methods
Properties
Constants
__construct()
init()
is_error()
is_empty()
count()
count_messages()
max()
min()
slice()
filter()
revert()
exists()
get()
get_compressed()
get_element()
get_parameters()
$incomplete
SEPARATOR_ELEMENT
length()
$raw_data
$mailbox
$meta
$params
$order
N/A
No private methods found
No private properties found
N/A

Constants

SEPARATOR_ELEMENT

SEPARATOR_ELEMENT = ' '

Properties

$incomplete

$incomplete

$raw_data

$raw_data

$mailbox

$mailbox

$meta

$meta

$params

$params

$order

$order

Methods

__construct()

__construct(mixed  $mailbox = null, mixed  $data = null, mixed  $order = null) : mixed

Object constructor.

Parameters

mixed $mailbox
mixed $data
mixed $order

Returns

mixed —

init()

init(string  $data = null) : mixed

Initializes object with SORT command response

Parameters

string $data

IMAP response string

Returns

mixed —

is_error()

is_error() : bool

Checks the result from IMAP command

Returns

bool —

True if the result is an error, False otherwise

is_empty()

is_empty() : bool

Checks if the result is empty

Returns

bool —

True if the result is empty, False otherwise

count()

count() : int

Returns number of elements in the result

Returns

int —

Number of elements

count_messages()

count_messages() : int

Returns number of elements in the result.

Alias for count() for compatibility with rcube_result_thread

Returns

int —

Number of elements

max()

max() : int|null

Returns maximal message identifier in the result

Returns

int|null —

Maximal message identifier

min()

min() : int|null

Returns minimal message identifier in the result

Returns

int|null —

Minimal message identifier

slice()

slice(int  $offset, int  $length) : mixed

Slices data set.

Parameters

int $offset

Offset (as for PHP's array_slice())

int $length

Number of elements (as for PHP's array_slice())

Returns

mixed —

filter()

filter(array  $ids = []) : mixed

Filters data set. Removes elements not listed in $ids list.

Parameters

array $ids

List of IDs to remove.

Returns

mixed —

revert()

revert() : mixed

Reverts order of elements in the result

Returns

mixed —

exists()

exists(int  $msgid, bool  $get_index = false) : mixed

Check if the given message ID exists in the object

Parameters

int $msgid

Message ID

bool $get_index

When enabled element's index will be returned. Elements are indexed starting with 0

Returns

mixed —

False if message ID doesn't exist, True if exists or index of the element if $get_index=true

get()

get() : array

Return all messages in the result.

Returns

array —

List of message IDs

get_compressed()

get_compressed() : array

Return all messages in the result.

Returns

array —

List of message IDs

get_element()

get_element(int|string  $index) : int|null

Return result element at specified index

Parameters

int|string $index

Element's index or "FIRST" or "LAST"

Returns

int|null —

Element value

get_parameters()

get_parameters(string  $param = null) : array|string

Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ or internal data e.g. MAILBOX, ORDER

Parameters

string $param

Parameter name

Returns

array|string —

Response parameters or parameter value

length()

length() : int

Returns length of internal data representation

Returns

int —

Data length